/******************************************************/
// Author: DFD in 2014-06-06
/******************************************************/

package asionreachel.cn.smarthomedemo.thread;

import android.app.Application;

import asionreachel.cn.smarthomedemo.base.Common;
import familyclient.android.thread.JGuiThread;

public class JFamilyClientApp extends Application
{
    private static JFamilyClientApp m_appInstance;
    public JFamilyClientApp()
    {
    }

    @Override
    public void onCreate()
    {
        super.onCreate();
        m_appInstance = this;
        //初始化sp
        Common.initSharedPreferences();
        //在application里边初始化
        JGuiThread.Init( "www.gsll138.com", 18800, 19801, 18802 );
    }

    @Override
    public void onTerminate()
    {
        JGuiThread.UnInit();
        m_appInstance = null;
        super.onTerminate();
    }
    /**
     * 获取全局上下文
     *
     * @return
     */
    public synchronized static JFamilyClientApp getInstance() {
        return m_appInstance;
    }
}